// 导入vue-router
import { createRouter, createWebHistory } from 'vue-router'

// 导入页面
import LoginVue from '@/views/Login.vue'
import LayoutVue from '@/views/Layout.vue'

// 定义路由关系
const routes = [
  {
    path: '/',
    name: 'Layout',
    component: LayoutVue,
    redirect: '/article/manage',
    children: [
      {
        path: '/article/category',
        component: () => import('@/views/article/ArticleCategory.vue')
      },
      {
        path: '/article/manage',
        component: () => import('@/views/article/ArticleManage.vue')
      },
      {
        path: '/user/UserAvatar',
        component: () => import('@/views/user/UserAvatar.vue')
      },
      {
        path: '/user/UserInfo',
        component: () => import('@/views/user/UserInfo.vue')
      },
      {
        path: '/user/UserResetPassword',
        component: () => import('@/views/user/UserResetPassword.vue')
      }
    ]
  },
  {
    path: '/login',
    name: 'Login',
    component: LoginVue,
  }
]
// 创建路由实例
const router = createRouter({
  history: createWebHistory(),
  routes
})

export default router

